package com.luyue.zagj.view;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.widget.TextView;

import com.luyue.zagj.R;


/**
 * Created by Administrator on 2016/5/24.
 */
public class DialogPopView extends BasePopupWindow implements View.OnClickListener{

    private View popupView;

    private OnSurePopupClickListener mOnSurePopupClickListener;
    public DialogPopView(Activity context) {
        super(context);

        TextView sure= (TextView) mPopupView.findViewById(R.id.dialog_sure);
        sure.setOnClickListener(this);
    }

    @Override
    public Animation getAnimation() {
        return null;
    }

    @Override
    public AnimationSet getAnimationSet() {
        return null;
    }

    @Override
    public View getInputView() {
        return null;
    }

    @Override
    public View getDismissView() {
        return popupView.findViewById(R.id.pop_click_to_dismiss);
    }

    @Override
    public View getPopupView() {
        popupView= LayoutInflater.from(mContext).inflate(R.layout.dialog_nav,null);
        return popupView;
    }

    @Override
    public View getAnimaView() {
        return popupView.findViewById(R.id.pop_anima);
    }

    @Override
    public View getCloseView() {
        return popupView.findViewById(R.id.dialog_cancel);
    }

    @Override
    public View getSureView() {
        return null;
    }
    public OnSurePopupClickListener getOnCommentPopupClickListener() {
        return mOnSurePopupClickListener;
    }


    public void setOnSurePopupClickListener(OnSurePopupClickListener onCommentPopupClickListener) {
        mOnSurePopupClickListener = onCommentPopupClickListener;
    }

    public interface OnSurePopupClickListener {
        void onSureClick(View v);
    }
    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.dialog_sure:
                if (mOnSurePopupClickListener != null) {
                    mOnSurePopupClickListener.onSureClick(view);
                break;
        }

        }
    }
}
